package main

import (
	"fmt"
	"git.oschina.net/YPTArch/auth/models"
	"git.oschina.net/YPTArch/auth/libs/base64"
)

func main() {
	//secretKey := []byte("jfsfkshlhglmskllgsfjlafd;e4*23)4")
	//需要去加密的字符串
	plaintext := []byte("wo shi shei a !")

	ciphertext, err := models.AesEncrypt(plaintext)
	if err != nil {
		fmt.Println(err)
	}

	cipherte := base64.Base64Encode(ciphertext)

	fmt.Println(cipherte, "=======1======")


	ciphertext11, err := base64.Base64Decde(cipherte)
	if err != nil {
		fmt.Println("=======3===========")
	}

	tmp, err := models.AesDecrypt(ciphertext11)
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(string(tmp), "========2=====")

}
